package training_enum

import "gitee.com/lailonghui/vehicle-supervision-framework/pkg/dicts"

// 教育培训-培训信息类型
type trainingInfoType int

var TrainingInfoType trainingInfoType

// 企业自我培训
func (c *trainingInfoType) EnterpriseSelf() int {
	return 1
}

// 交警下发培训
func (c *trainingInfoType) TrafficPolice() int {
	return 2
}

func (c *trainingInfoType) ToText(value int) string {
	switch value {

	case 1:
		return "企业自我培训"

	case 2:
		return "交警下发培训"

	}
	return ""
}

func (c *trainingInfoType) ToDict(value int) *dicts.IntDict {
	return &dicts.IntDict{
		Text:  c.ToText(value),
		Value: value,
	}
}

func (c *trainingInfoType) ToValue(text string) int {
	switch text {

	case "企业自我培训":
		return 1

	case "交警下发培训":
		return 2

	}
	return 0
}
